package com.medical.controller;

import com.medical.pojo.UsageVO;
import com.medical.pojo.UsageWith;
import com.medical.service.UsageWithService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/usageWith")
public class UsageWithController {

    @Autowired
    private UsageWithService usageWithService;

    @RequestMapping("/list")
    public List<UsageWith> list(@RequestBody UsageVO usageVO){
        return usageWithService.list(usageVO);
    }

    @RequestMapping("/findCurrentUsage")
    public List<String> findCurrentUsage(@RequestBody UsageVO usageVO){
        return usageWithService.findCurrentUsage(usageVO);
    }
    @RequestMapping("/findLastYearUsage")
    public List<String> findLastYearUsage(@RequestBody UsageVO usageVO){
        return usageWithService.findLastYearUsage(usageVO);
    }

    @RequestMapping("/findWithResults")
    public List<Integer> findWithResults(@RequestBody UsageVO usageVO){
        return usageWithService.findWithResults(usageVO);
    }
}
